package com.easychat.service;

import com.easychat.common.Result;
import com.easychat.entity.UserContactApply;
import com.easychat.entity.query.UserContactApplyQuery;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;

/**
 * (UserContactApply)表服务接口
 *
 * @author makejava
 * @since 2024-10-08 20:03:16
 */
public interface UserContactApplyService {

    /**
     * 通过ID查询单条数据
     *
     * @param applyId 主键
     * @return 实例对象
     */
    UserContactApply queryById(Integer applyId);

    /**
     * 分页查询
     *
     * @param userContactApply 筛选条件
     * @param pageRequest      分页对象
     * @return 查询结果
     */
    Page<UserContactApply> queryByPage(UserContactApply userContactApply, PageRequest pageRequest);

    /**
     * 新增数据
     *
     * @param userContactApply 实例对象
     * @return 实例对象
     */
    UserContactApply insert(UserContactApply userContactApply);

    /**
     * 修改数据
     *
     * @param userContactApply 实例对象
     * @return 实例对象
     */
    UserContactApply update(UserContactApply userContactApply,Integer applyId);

    /**
     * 通过主键删除数据
     *
     * @param applyId 主键
     * @return 是否成功
     */
    boolean deleteById(Integer applyId);

    /**
     * 分页查询好友申请或入群申请
     * @param pageRequest
     * @param userContactApplyQuery
     * @return
     */
    Result<UserContactApply> selectByReceiveIdPage(PageRequest pageRequest, UserContactApplyQuery userContactApplyQuery);

    void dealWithApply(String userId, Integer applyId, Integer status);

    void addContact(String applyUserId,String receiveUserId,String contactId,Integer contactType,String applyInfo);
}
